{% extends "base.html" %}
{% block content %}
<div class="container">
    <h2>{{ blog_title }}</h2>
    <a href="/posts/new/{{ blog_id }}"><button class="btn btn-primary">New post</button></a>
    {% if posts|length > 0 %}
        {% for post in posts %}
            <h3>{{ post.title }}</h3>
            <p>{{ post.content }}</p>
            <p>{{ post.author }}</p>
            <hr>
        {% endfor %}
    {% else %}
        <h4>There aren't any posts yet!</h4>
    {% endif %}
</div>
{% endblock %}